<extend name="./public/frame.html"/>
<block name="content">

    <div>待审核总条数：<span style="color: #5FB878;"><b>{$wait_check_count}</b></span>条</div>

    <table class="layui-table">
        <tr>
            <td>风控安全条件</td>
            <td>
                <ul>
                    <volist name="safe_condition_select" id="item" key="">
                        <li style="line-height: 24px;">{$key+1}、{$item.content}</li>
                    </volist>
                </ul>
            </td>
        </tr>
    </table>

    <input type="text" value="{$ids}" id="ids"  hidden />

    <div id="check_result">
        <b style="color: green;">审核成功条数:<span style="font-size: 24px;"></span>条</b>
        <b style="color: red;margin-left: 150px;">审核失败条数:<span style="font-size: 24px;"></span>条</b>
    </div>
    

    <if condition="$wait_check_count gt 0">
        <button class="layui-btn" lay-submit="" lay-filter="submit" id="submits">提交审核</button>
    </if>

    <script>
        layui.use(['form','layer'], function(){
            var form = layui.form,
                layer = layui.layer;

            $('#check_result').hide();

            $(document).on('click', '#submits', function () {
                layer.confirm('确认提交？！', function(index){
                    var act = 'batch_deal';
                    var ids = $('#ids').val();
                    $.post('/admin/driver_wind/batchInfo',{'act': act, 'ids': ids}, function (res) {
                        if(res['code'] == 0) {
                            $("#submits").hide();
                            $('#check_result').show();
                            $('#check_result span').eq(0).html(res['data']['success_count']);
                            $('#check_result span').eq(1).html(res['data']['abnormal_count']);

//                            setTimeout('parent.window.location.reload();',5000);
                        } else {
                            layui.alert(res['msg']);
                        }
                    }, 'json');
                    layer.close(index);
                });
            });
        });
    </script>
</block>